package metodologia;

import gui.JanelaSubTestes;
import gui.JanelaDeDados;
import edu.uci.ics.jung.graph.DirectedSparseGraph;
import java.io.Serializable;

public class TestNode implements Serializable {

    private int id, type, catid; // good coding practice would have this as private
    private DirectedSparseGraph<ToDoNode, String> g;
    private double X,Y;
    private JanelaSubTestes todoscreen;
    private JanelaDeDados janelaDeDados;
    private int state;

    public TestNode(int id, int type, int catid) {
        this.id = id;
        this.type = type;
        this.catid = catid;
        g = new DirectedSparseGraph<ToDoNode, String>();
        todoscreen = new JanelaSubTestes(this);
        janelaDeDados = new JanelaDeDados(this);
        state = 0;
    }
    
    public TestNode(int id, int type, int catid, DirectedSparseGraph<ToDoNode, String> g1) {
        this.id = id;
        this.type = type;
        this.catid = catid;
        g = g1;
        todoscreen = new JanelaSubTestes(this);
        janelaDeDados = new JanelaDeDados(this);
        state = 0;
    }

    @Override
    public String toString() { // Always a good idea for debuging
        switch (this.type) {
            case 0:
                return "Start";
            case 2:
                return "Test" + catid;
            case 1:
                return "End";
        }
        return "Start";       // JUNG2 makes good use of these.
    }


    public int getType() {
        return this.type;
    }

    public int getCatid() {
        return this.catid;
    }

    public int getId() {
        return this.id;
    }

    public double getX() {
        return X;
    }

    public void setX(double X) {
        this.X = X;
    }

    public double getY() {
        return Y;
    }

    public void setY(double Y) {
        this.Y = Y;
    }

    public DirectedSparseGraph<ToDoNode, String> getG() {
        return g;
    }

    public void setG(DirectedSparseGraph<ToDoNode, String> g) {
        this.g = g;
    }

    public JanelaSubTestes getTodoscreen() {
        return todoscreen;
    }

    public void setTodoscreen(JanelaSubTestes todoscreen) {
        this.todoscreen = todoscreen;
    }

    public JanelaDeDados getJanelaDeDados() {
        return janelaDeDados;
    }

    public void setJanelaDeDados(JanelaDeDados janelaDeDados) {
        this.janelaDeDados = janelaDeDados;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
    
}
